* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa, #e4e7f1);
    color: #333;
    width:100%;
    height: 100vh;
}

.container {
    display: flex;
    height: 100vh;
    padding: 12px;
    gap: 12px;
}

/* 面板通用样式 */
.panel {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e1e5eb;
    transition: all 0.3s ease;
    width:100%;
}

.panel:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
}

.panel-header {
    background: #f8fafc;
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    color: #2d3748;
    position: fixed;
    top: 0;
    width:100%;
    /*position: sticky;*/
}

.panel-header i {
    margin-right: 10px;
    color: #4c6ef5;
}

/* 左侧面板 - 组件库 */
.left-panel {
    display: flex;
    width: 100%;
    overflow-y: auto;
}

.components-container {
    width: 100%;
    padding: 10px;
}

.accordion {
    width: 100%;
    margin-bottom: 0px;
    background: #f8fafc;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    border: 1px solid #e9ecef;
}
.accordion .active{
    width: 100%;
}

.accordion-header {
    padding: 14px 16px;
    background: #f1f5f9;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    color: #3b4a5f;
}

.accordion-header:hover {
    background: #e9f0ff;
}

.accordion-header i {
    transition: transform 0.3s ease;
    color: #4c6ef5;
}

.accordion-header.active i {
    transform: rotate(90deg);
}
@media (min-width: 50px) and (max-width: 259px){
    .components-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
    }
    .component-item {
        max-width: 80px;
        box-sizing: border-box;
    }
}
@media (min-width: 260px) and (max-width: 330px){
    .components-grid {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        max-height: 0;
        overflow: auto;
        transition: max-height 0.3s ease, padding 0.3s ease;
    }
    .component-item {
        max-width: 80px;
        box-sizing: border-box;
    }

}
@media (min-width: 331px)and (max-width: 800px){
    .components-grid {
        display: grid;
        width: 100%;
        /*grid-template-columns: repeat(4, 1fr);*/
        grid-template-columns: repeat(4, auto);;
        gap: 12px;
        max-height: 0;
        overflow: auto;
        transition: max-height 0.3s ease, padding 0.3s ease;
    }
    .component-item {
        max-width: 80px;
        box-sizing: border-box;
    }
}


.accordion.active .components-grid {
    max-height: 8000px;
    padding: 0px;
}

.component-item {
    background: #ffffff;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    cursor: grab;
    transition: all 0.3s ease;
    border: 1px solid #e1e5eb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.component-item:hover {
    transform: translateY(-3px);
    background: #f8fafc;
    box-shadow: 0 6px 12px rgba(76, 110, 245, 0.15);
    border-color: #d0dbf9;
}

.component-item i {
    font-size: 24px;
    margin-bottom: 8px;
    color: #4c6ef5;
}

.component-item h3 {
    font-size: 13px;
    margin-top: 5px;
    color: #3b4a5f;
}

/* 中间面板 - 画布 */
.center-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.canvas-toolbar {
    display: flex;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e9ecef;
    flex-wrap: wrap;
    gap: 8px;
}

.tool-btn {
    background: #f1f5f9;
    border: 1px solid #e1e5eb;
    color: #3b4a5f;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
}

.tool-btn:hover {
    background: #e9f0ff;
    border-color: #c2d0ff;
    color: #4c6ef5;
}

.tool-btn i {
    margin-right: 6px;
    font-size: 14px;
}

.canvas-container {
    position: relative;
    flex: 1;
    background: #f8fafc;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image:
            linear-gradient(#e1e5eb 1px, transparent 1px),
            linear-gradient(90deg, #e1e5eb 1px, transparent 1px);
    background-size: 20px 20px;
}

.canvas {
    position: relative;
    width: 1200px;
    height: 700px;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e5eb;
    border-radius: 8px;
    overflow: hidden;
}

/* 右侧面板 - 属性设置 */
.right-panel {
    width: 100%;
}

.properties-container {
    padding: 20px;
    overflow-y: auto;
    height: 100%;
}

.property-group {
    margin-bottom: 25px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.property-group h4 {
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e1e5eb;
    color: #4c6ef5;
    display: flex;
    align-items: center;
    font-size: 15px;
}

.property-group h4 i {
    margin-right: 8px;
    font-size: 16px;
}

.property-item {
    margin-bottom: 16px;
}

.property-item label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: #4a5568;
    font-weight: 500;
}

.property-item input,
.property-item select,
.property-item textarea {
    width: 100%;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #e1e5eb;
    border-radius: 8px;
    color: #2d3748;
    font-size: 14px;
    transition: all 0.2s;
}

.property-item input:focus,
.property-item select:focus,
.property-item textarea:focus {
    border-color: #4c6ef5;
    box-shadow: 0 0 0 3px rgba(76, 110, 245, 0.15);
    outline: none;
}

/* 画布组件样式 */
.canvas-component {
    position: absolute;
    cursor: move;
    border: 1px solid transparent;
    transition: all 0.2s;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e1e5eb;
}

.canvas-component:hover {
    border: 1px solid #c2d0ff;
    box-shadow: 0 6px 16px rgba(76, 110, 245, 0.15);
}

.canvas-component.selected {
    border: 2px solid #4c6ef5;
    box-shadow: 0 0 0 3px rgba(76, 110, 245, 0.2);
}

.component-header {
    padding: 10px 12px;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    border-bottom: 1px solid #e9ecef;
}

.component-title {
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
}

.component-actions {
    display: flex;
}

.component-action {
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.component-action:hover {
    background: #f1f5f9;
    color: #4c6ef5;
}

.component-content {
    padding: 15px;
    height: calc(100% - 40px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.chart-container {
    width: 100%;
    height: 100%;
}

.chart-placeholder {
    width: 100%;
    height: 100%;
    background: #f8fafc;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #a0aec0;
    font-size: 13px;
    flex-direction: column;
    border-radius: 6px;
}

.no-selection {
    text-align: center;
    padding: 40px 20px;
    color: #a0aec0;
    background: #f8fafc;
    border-radius: 10px;
    margin: 20px;
}

.no-selection i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #c2d0ff;
}

/* 响应式布局 */
@media (max-width: 1200px) {
    .left-panel {
        width: 100%;
    }
    .right-panel {
        width: 100%;
    }
}

/* 搜索框 */
.search-box {
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e9ecef;
}

.search-box input {
    width: 100%;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #e1e5eb;
    border-radius: 8px;
    color: #2d3748;
    font-size: 14px;
    transition: all 0.2s;
}

.search-box input:focus {
    border-color: #4c6ef5;
    box-shadow: 0 0 0 3px rgba(76, 110, 245, 0.15);
    outline: none;
}

/* 组件标签 */
.component-tag {
    display: inline-block;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    margin-top: 5px;
    background: #e9f0ff;
    color: #4c6ef5;
    font-weight: 500;
}

/* 顶部标题 */
.app-header {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.app-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-title h1 {
    font-size: 22px;
    color: #2d3748;
    font-weight: 700;
}

.app-title span {
    color: #4c6ef5;
}

.app-actions {
    display: flex;
    gap: 10px;
}

.app-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.primary-btn {
    background: #4c6ef5;
    color: white;
    border: none;
}

.secondary-btn {
    background: #f1f5f9;
    color: #4a5568;
    border: 1px solid #e1e5eb;
}

.app-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.primary-btn:hover {
    background: #3d5af0;
}

.secondary-btn:hover {
    background: #e9f0ff;
    border-color: #c2d0ff;
    color: #4c6ef5;
}

/* 状态指示器 */
.status-bar {
    padding: 10px 24px;
    background: #f8fafc;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    color: #718096;
    font-size: 13px;
}

/* 水印 */
.watermark {
    position: fixed;
    bottom: 20px;
    right: 20px;
    color: rgba(200, 210, 230, 0.6);
    font-size: 12px;
    z-index: 1000;
}
